﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using haptic.src.engine;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using haptic.src.engine.core;

namespace haptic.src.components
{
    [Serializable]
    public class cAmbientSound : Component
    {
        public cAmbientSound(){}
        public cAmbientSound(Entity oOwner) : base(oOwner) { }

        #region Load
        public override Result Load(haptic.src.engine.Scene oGame, ContentManager oContent)
        {
            if (m_sSoundPath != null)
            {
                m_oSound = oContent.Load<SoundEffect>(m_sSoundPath);
            }
            return Result.Success;
        }
        public override void Start()
        {
            if (m_oSound != null)
                m_oSound.Play(1.0f, 0.0f, 0.0f, true);
        }
        #endregion

        #region Attributes
        public string m_sSoundPath;
        private SoundEffect m_oSound;
        #endregion
    }
}
